package top.moyinzi.sakura.jmt;

import org.apache.log4j.FileAppender;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.SimpleLayout;
import top.moyinzi.sakura.jmt.tools.HelloWorld;

/**
 * Created by moyin on 2018/5/6.
 */
public class Main {

    public static void main(String[] args) {
        Logger logger = Logger.getLogger(Main.class);
        SimpleLayout layout = new SimpleLayout();
        FileAppender appender = null;
        try
        {
            //把输出端配置到out.txt
            appender = new FileAppender(layout,"out.txt",false);
        } catch(Exception e) {
            logger.error(e);
        }
        logger.addAppender(appender);//添加输出端
        logger.setLevel(Level.DEBUG);//覆盖配置文件中的级别
        logger.debug("debug");
        logger.info("info");
        logger.warn("warn");
        logger.error("error");
        logger.fatal("fatal");

        HelloWorld.doit();
    }
}
